package hb.rj.demand.service;

import hb.rj.demand.entity.Students;
import hb.rj.demand.mapper.StudentsMapper;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@ComponentScan("hb.rj.demand.entity")
public class StudentsServiceImpl implements StudentsService{
    @Resource
    StudentsMapper studentsMapper;

    @Override
    public int insertStudentInfo(Students students) {
        return studentsMapper.insertStudent(students);
    }

    @Override
    public int modifyStudentInfo(Students students) {
        int i = studentsMapper.modifyStudent(students);
        return i;
    }

    @Override
    public Students findByNameInfo(String name) {
        Students students=studentsMapper.findByName(name);
        return students;
    }

    @Override
    public int deleteByNameInfo(String name) {
        int i=studentsMapper.deleteByName(name);
        return i;
    }
}
